<?php
 namespace App\Http\Controllers; use Illuminate\Support\Facades\Input; use TechOnline\Laravel\Dao\ModelUtil; use TechOnline\Laravel\Http\Response; use TechOnline\Utils\PageHtmlUtil; class JobController extends BaseController { public function index() { $page = Input::get('page'); $pageSize = 10; $option = []; $option['order'] = ['id', 'desc']; $productPaginate = ModelUtil::paginate('job', $page, $pageSize, $option); $jobs = $productPaginate['records']; $pageHtml = PageHtmlUtil::render($productPaginate['total'], $pageSize, $page, '/job?page={page}'); $viewData = []; $viewData['jobs'] = $jobs; $viewData['pageHtml'] = $pageHtml; return $this->_view('job', $viewData); } public function view($jobId) { $jobId = intval($jobId); $job = ModelUtil::get('job', ['id' => $jobId]); if (empty($job)) { return Response::send(-1, '未找到'); } $viewData = []; $viewData['job'] = $job; return $this->_view('jobView', $viewData); } } 